@mixin cnsl-form-field-theme($theme) {
  $primary: map-get($theme, primary);
  $primary-color: map-get($primary, 500);
  $is-dark-theme: map-get($theme, is-dark);
  $foreground: map-get($theme, foreground);

  .ng-untouched {
    .cnsl-error {
      visibility: hidden;
      transition: visibility 0.2 ease;
    }
  }

  .cnsl-form-field-wrapper {
    width: 100%;
    margin: 10px 0;

    .mat-datepicker-toggle button {
      padding: 0;
      height: 40px;
      width: 40px;
      display: flex;
      justify-content: center;
      align-items: center;
    }
  }

  .cnsl-rel {
    position: relative;
  }

  [cnslSuffix] {
    position: absolute;
    right: 0.5rem;
    top: 9px;
    height: inherit;
    vertical-align: middle;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  input {
    color: map-get($foreground, text);
  }

  // Wrapper for the hints and error messages.
  .cnsl-form-field-subscript-wrapper {
    position: absolute;
    box-sizing: border-box;
    width: 100%;
    overflow: hidden; // prevents multi-line errors from overlapping the control
  }

  mat-dialog-container .cnsl-form-field-subscript-wrapper {
    width: auto;
  }

  .cnsl-form-field-hint-wrapper,
  .cnsl-form-field-error-wrapper {
    display: flex;
  }
}
